﻿@using www.Controllers
@using www.SService
@{
    ViewBag.Title = "Danh sách thông tin liên lạc";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}
@Html.ActionLink("Thêm mới", "Add", "Contact")
<div class="clear"></div>
<div class="content">
    <div class="col-left">Loại</div>
    <div class="col-right">
        @if (ViewData["Type"] != null)
        {
            using (@Html.BeginForm("Index", "Contact", FormMethod.Post, new { id = "frmad" }))
            {
            @Html.DropDownList("Type", null,new { onchange = "frmad.submit();" ,@class = "combobox"})
            }
        }
    </div>
</div>

<fieldset>
    <legend>Danh sách</legend>
    <div class="clear"></div>
    <table style="width: 100%; height: auto; border: 1px solid #008080;" cellpadding="1" cellspacing="1">
          @if (ViewData["Data"] != null)
        {
            <tr style="background: #0000cd; color: #fff; height: 30px; font-size: 13px; font-weight: bold;text-align: center;">
                <th style="width: 12%;">Họ tên </th>
                <th style="width: 13%;">Công ty</th>
                <th style="width: 13%;">Địa chỉ</th>
                <th style="width: 7%;">Số ĐT</th>
                <th style="width: 10%;">EMail</th>
                <th style="width: 13%;">Tiêu đề</th>
                <th style="width: 6%;">Ngày</th>
                <th style="width: 6%;">Trả lời</th>
                <th style="width: 7%;">Trạng thái</th>
                <th style="width: 13%;">Thao tác</th>
            </tr>
            foreach (var item in (List<RelaxContactDataContract>)ViewData["Data"])
            {
            <tr style="height: 25px;">
                <td>@item.Name</td>
                <td>@item.Company</td>
                <td>@item.Address</td>
                <td>@item.Tel</td>
                <td>@item.Email</td>
                <td>@item.Title</td>
                <td>@item.Date.ToShortDateString()</td>
                <td>@Utility.Isanswer(item.IsAnswer)</td>
                <td>@Utility.Active(item.Active)</td>
                <td>@Html.ActionLink("Trả lời","Isanswer",new{id=item.Id})|@Html.ActionLink("Sửa","Edit",new{id=item.Id}) | @Html.ActionLink("Xóa","Delete",new{id=item.Id},new {onclick="return confirmDelete();"})|@Html.ActionLink("Chi tiết","Detail",new{id=item.Id})</td>
            </tr>
            }

        }
    </table>
</fieldset>
